package com.xbongbong.paas.pojo.dto;

import com.alibaba.fastjson.JSONObject;
import com.xbongbong.paas.domain.entity.ext.ConditionsEntityExt;
import com.xbongbong.paas.enums.DelEnum;
import com.xbongbong.paas.pojo.ShareConditionFormatPojo;
import com.xbongbong.paas.toolbox.wrap.BaseDTO;
import com.xbongbong.paas.toolbox.wrap.QueryIgnore;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import javax.validation.constraints.NotNull;
import java.util.ArrayList;
import java.util.List;

/**
 * @author: wufeng
 * @date: 2018/12/17 16:06
 * @desrcption: 数据汇总接口
 */
@Getter
@Setter
@ToString
public class FormDataSummaryDTO extends BaseDTO {
    private static final long serialVersionUID = -7322938703415467463L;

    /**
     * 应用id
     */
    @NotNull(message = "{dto.msg.formDataSummary.appId.NotNull}")
    private Long appId;

    @NotNull(message = "{dto.msg.formDataSummary.formId.NotNull}")
    private Long formId;

    @Getter(onMethod_ = {@QueryIgnore})
    private Long listGroupId;

    /**
     * 搜索条件
     */
    @Getter(onMethod_ = {@QueryIgnore})
    private List<ConditionsEntityExt> conditions;

    /**
     *  or：任一； and：全部（筛选项的条件是任一一个满足，还是需要全部满足）
     */
    @Getter(onMethod_ = {@QueryIgnore})
    private String rel;

    private Integer del;

    /**
     * saas标记
     */
    @Getter(onMethod_ = {@QueryIgnore})
    private Integer saasMark;

    /**
     * 业务类型
     */
    @Getter(onMethod_ = {@QueryIgnore})
    private Integer businessType;

    /**
     * 业务类型
     */
    @Getter(onMethod_ = {@QueryIgnore})
    private Integer subBusinessType;

    /**
     * 是否是默认分组
     */
    @Getter(onMethod_ = {@QueryIgnore})
    private Integer defaultGroup;

    @Getter(onMethod_ = {@QueryIgnore})
    private List<List<ConditionsEntityExt>> shouldConditions = new ArrayList<>();

    /**
     * 共享权限条件
     */
    @Getter(onMethod_ = {@QueryIgnore})
    private ShareConditionFormatPojo sharePermission;

    @Getter(onMethod_ = {@QueryIgnore})
    private String nameLike;

    /**
     * saas列表数据状态
     */
    @Getter(onMethod_ = {@QueryIgnore})
    private Integer statusFilter;
    /**
     * 菜单id
     */
    private Long menuId;

    /**
     * 特殊列表筛选
     */
    @Getter(onMethod_ = {@QueryIgnore})
    private JSONObject commonFilter;

    public FormDataSummaryDTO(){
        rel = "and";
        del = DelEnum.NORMAL.getDel();
    }
}
